package org.xin.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.xin.common.GlableRun;

/**
 * @author ：xin
 * @date ：Created in 2021/9/29
 * @desc <p>  </p>
 * @modified By：$
 * @version: $
 */
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = {"org.xin"})
public class GatewayApp {
    public static void main(String[] args) {
        ConfigurableApplicationContext application = SpringApplication.run(GatewayApp.class);
        logInfo(application);
    }
    //启动成功
    private static void logInfo(ConfigurableApplicationContext application)  {
        Environment env = application.getEnvironment();
        //获取配置的端口
        //IPUtil.getServerIp()获取本机IP，本机使用Hutool工具
        String port = env.getProperty("server.port");
        GlableRun.print(port);
    }
}
